model.eval()
fig, ax = plt.subplots(1,1)
ax.plot(x, y_target.squeeze().numpy(),'ob')

predict = model(x_input)
predict = predict.data.numpy()
ax.plot(x,predict,'r-',label='degree=2')

plt.xlabel('X')
plt.ylabel('y')
ax.legend(loc='upper center',frameon=False)
plt.show()  
